<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr=['赵云','黄忠','关羽','张飞','刘备','诸葛亮','马超','曹操']
        //0-7
        let k=Math.floor(Math.random()*(7+1))
        document.write(arr[k])
        //arr.splice(k,3)
        arr.splice(k,1)
        console.log(arr)
    </script>
</body>
</html>